package com.entity;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the INVOICE database table.
 * 
 */
@Entity
@NamedQuery(name="Invoice.findAll", query="SELECT i FROM Invoice i")
public class Invoice implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="INVOICE_INID_GENERATOR", sequenceName="SEQ",initialValue=1,allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="INVOICE_INID_GENERATOR")
	@Column(name="IN_ID")
	private long inId;

	@Column(name="IN_CHARGE")
	private String inCharge;

	@Column(name="IN_COM")
	private String inCom;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="IN_DATE")
	private Date inDate;

	@Column(name="IN_ETC")
	private String inEtc;

	@Column(name="IN_ETCMONEY")
	private BigDecimal inEtcmoney;

	@Column(name="IN_NUM")
	private BigDecimal inNum;

	@Column(name="IN_ODDNUM")
	private String inOddnum;

	@Column(name="IN_REMARK")
	private String inRemark;

	@Column(name="IN_STATE")
	private BigDecimal inState;

	//bi-directional many-to-one association to Odo
	@ManyToOne
	@JoinColumn(name="ODO_ID")
	private Odo odo;
	
	@OneToMany(cascade={CascadeType.ALL},mappedBy="invoice")
	private List<Reciverpeople> reciverpeoples;
	

	public List<Reciverpeople> getReciverpeoples() {
		return reciverpeoples;
	}

	public void setReciverpeoples(List<Reciverpeople> reciverpeoples) {
		this.reciverpeoples = reciverpeoples;
	}

	public Invoice() {
	}

	public long getInId() {
		return this.inId;
	}

	public void setInId(long inId) {
		this.inId = inId;
	}

	public String getInCharge() {
		return this.inCharge;
	}

	public void setInCharge(String inCharge) {
		this.inCharge = inCharge;
	}

	public String getInCom() {
		return this.inCom;
	}

	public void setInCom(String inCom) {
		this.inCom = inCom;
	}

	public Date getInDate() {
		return this.inDate;
	}

	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}

	public String getInEtc() {
		return this.inEtc;
	}

	public void setInEtc(String inEtc) {
		this.inEtc = inEtc;
	}

	public BigDecimal getInEtcmoney() {
		return this.inEtcmoney;
	}

	public void setInEtcmoney(BigDecimal inEtcmoney) {
		this.inEtcmoney = inEtcmoney;
	}

	public BigDecimal getInNum() {
		return this.inNum;
	}

	public void setInNum(BigDecimal inNum) {
		this.inNum = inNum;
	}

	public String getInOddnum() {
		return this.inOddnum;
	}

	public void setInOddnum(String inOddnum) {
		this.inOddnum = inOddnum;
	}

	public String getInRemark() {
		return this.inRemark;
	}

	public void setInRemark(String inRemark) {
		this.inRemark = inRemark;
	}

	public BigDecimal getInState() {
		return this.inState;
	}

	public void setInState(BigDecimal inState) {
		this.inState = inState;
	}

	public Odo getOdo() {
		return this.odo;
	}

	public void setOdo(Odo odo) {
		this.odo = odo;
	}

	@Override
	public String toString() {
		return "Invoice [inId=" + inId + ", inCharge=" + inCharge + ", inCom=" + inCom + ", inDate=" + inDate
				+ ", inEtc=" + inEtc + ", inEtcmoney=" + inEtcmoney + ", inNum=" + inNum + ", inOddnum=" + inOddnum
				+ ", inRemark=" + inRemark + ", inState=" + inState + ", odo=" + odo + "]";
	}
	
	

}